Fix func command usage format and conditionally display [subcontext] placeholder#4562
Merged
surgupta-msft merged 4 commits intomainfrom Aug 1, 2025
Merged
Fix func command usage format and conditionally display [subcontext] placeholder#4562surgupta-msft merged 4 commits intomainfrom
surgupta-msft merged 4 commits intomainfrom
Conversation
…bcontext display Co-authored-by: surgupta-msft <16623184+surgupta-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Bug] Fix the func command usage format
Fix func command usage format to remove duplicate [context] placeholder
Jul 31, 2025
Member
|
Validated the following: Kubernetes for example does not have have a subcontext, is it possible to display "subcontext" when we know the context has subcontext? |
…exts exist Co-authored-by: liliankasem <2198905+liliankasem@users.noreply.github.com>
Contributor
Author
... Yes, absolutely! I've implemented exactly that change. The help display now conditionally shows Changes made in commit 7a674fa:
The code now checks if any subcontexts exist using the existing |
Copilot
AI
changed the title
Fix func command usage format to remove duplicate [context] placeholder
Fix func command usage format and conditionally display [subcontext] placeholder
Jul 31, 2025
liliankasem
approved these changes
Jul 31, 2025
surgupta-msft
approved these changes
Jul 31, 2025
aishwaryabh
approved these changes
Aug 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
funccommand help output was showing an incorrect usage format with duplicate[context]placeholders and displaying[subcontext]even for contexts that don't have any subcontexts, which was confusing for users.Problem
The help system had two issues:
func [context] [context] <action>suggesting users could provide two context parameters[subcontext]even when they had no subcontexts (e.g.,kubernetes)For example:
But
kuberneteshas no subcontexts, making this confusing.Solution
Fixed usage format strings in
HelpAction.cs:func [context] [context] <action>tofunc [context] <action>[subcontext]only when the context actually has subcontextsExamples
Before:
Usage: func [context] [context] <action> [-/--options]Usage: func azure [subcontext] <action> [-/--options]✓Usage: func kubernetes [subcontext] <action> [-/--options]❌After:
Usage: func [context] <action> [-/--options]Usage: func azure [subcontext] <action> [-/--options]✓ (has subcontexts)Usage: func kubernetes <action> [-/--options]✓ (no subcontexts)The fix ensures the usage format accurately reflects the actual command structure and only shows placeholders when they're actually applicable.
Fixes #4561.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.